{extend name="main"}
{block name="style"}
{css href="__TEMPLATE_STATIC__/user.css"}
<style>
.w-200px{width: 200px !important;}
</style>
{/block}
{block name="header"}
{include file="module/user_top_nav"/}
{/block}
{block name="body"}
<div class="flex1 flex h-100">
	<div class="w-180px nav-left p-4 overflow-y-auto">
	{include file="module/user/personal_left"/}
	</div>
	<div class="frame-body flex-1 overflow-y-auto py-3" ref="FrameBody">
		<div class="container-xl bg-white shadow">
			<div class="p-5">
				<div class="flex border-bottom border-lg">
					<div class="flex-1 block-title-before py-2">我的简历</div>
					<div class="py-2 text-secondary">
						最后更新{{Find.refresh_time}}
					</div>
					<div class="py-2 text-secondary pl-2">
						<el-link @click="setResumeRefreshTime();" type="success" :underline="false" class="small">刷新</el-link>
					</div>
				</div>
				<div class="flex pt-4 text-v-center text-primary">
					<div class="px-3">
						<h4>{{statistics.progress}}<small>%</small></h4>
						<p class="text-secondary mb-0">完整度</p>
					</div>
					<div class="px-3">
						<h4>{{statistics.collection}}</h4>
						<p class="text-secondary mb-0">简历被关注</p>
					</div>
					<div class="px-3">
						<h4>{{statistics.jobs_sum}}</h4>
						<p class="text-secondary mb-0">已申请职位</p>
					</div>
					<div class="px-3">
						<h4>{{statistics.invite_aninterview_sum}}</h4>
						<p class="text-secondary mb-0">面试邀请</p>
					</div>
				</div>
			</div>
			<!-- 基本信息 -->
			<div class="p-5 hover-show-block">
				<div class="flex">
					<div class="flex-1 block-title-before py-2">基本信息</div>
					<div class="text-v-center show-block">
						<div class="text-right">
						<el-link type="primary" icon="el-icon-edit" :underline="false" @click="showForm.basic= !showForm.basic" v-show="!showForm.basic">编辑</el-link>
						</div>
					</div>
				</div>
				<el-form :model="form" @submit.native.prevent="editComplete('basic');" :rules="rules" ref="basic" label-width="120px" label-position="right" class="pt-4" v-show="showForm.basic">
					<div class="flex">
						<div class="flex-1">
							<div class="flex">
								<div class="flex-1">
									<el-form-item label="姓名：" prop="name">
										<el-input v-model="form.name" class="w-200px rounded-0" maxlength="20" size="mini"></el-input>
									</el-form-item>
								</div>
								<div class="flex-1">
									<el-form-item label="性别：" prop="sex">
									    <el-radio-group class="ml-0 ml-sm-2" v-model="form.sex">
									      <el-radio :label="1">男</el-radio>
									      <el-radio :label="2">女</el-radio>
									    </el-radio-group>
									</el-form-item>
								</div>
							</div>
							<div class="flex">
								<div class="flex-1">
									<el-form-item label="出生年份：" prop="age">
										<el-date-picker
									      v-model="form.age"
									      type="month"
									      placeholder="出生年份"
									      size="mini"
									      class="rounded-0 w-200px"
									      format="yyyy.MM"
									      value-format="timestamp"
									      :default-value="Date.now()-(3600*24*365*16*1000)"
									      :picker-options="agePickerOptions">
									    </el-date-picker>
									</el-form-item>
								</div>
								<div class="flex-1">
									<el-form-item label="学历：" prop="educational_background">
										<el-select v-model="form.educational_background" filterable clearable default-first-option placeholder="请选择" size="mini" class="rounded-0 w-200px">
										    <el-option
										      v-for="item in educational_background"
										      :key="item.value"
										      :label="item.title"
										      :value="item.value">
										    </el-option>
										</el-select>
									</el-form-item>
								</div>
							</div>
							<div class="flex">
								<div class="flex-1">
									<el-form-item label="参加工作：" prop="work_experience_time">
										<el-date-picker
									      v-model="form.work_experience_time"
									      type="month"
									      placeholder="参加工作时间"
									      size="mini"
									      class="rounded-0 w-200px"
									      format="yyyy.MM"
									      value-format="timestamp"
									      :picker-options="workExperienceTimePickerOptions">
									    </el-date-picker>
									</el-form-item>
								</div>
								<div class="flex-1">
									<el-form-item label="专业：" prop="specialities">
										<el-autocomplete v-model="form.specialities" class="w-200px rounded-0" maxlength="30" size="mini"
									    :fetch-suggestions="getSpecialities"
									    :trigger-on-focus="false"
									    clearable></el-autocomplete>
									</el-form-item>
								</div>
							</div>
							<div class="flex">
								<div class="flex-1">
									<el-form-item label="居住地：" prop="residence">
										<el-select v-model="form.residence" filterable clearable default-first-option placeholder="请选择" size="mini" class="rounded-0 w-200px">
											<el-option-group
										      v-for="group in city_list"
										      :key="group.title"
										      :label="group.title">
										      <el-option
										        v-for="item in group.data"
										        :key="item.id"
										        :label="item.title"
										        :value="item.id">
										      </el-option>
										    </el-option-group>
										</el-select>
									</el-form-item>
								</div>
								<div class="flex-1">
									<el-form-item label="籍贯：" prop="native_place">
										<el-select v-model="form.native_place" filterable clearable default-first-option placeholder="请选择" size="mini" class="rounded-0 w-200px">
											<el-option-group
										      v-for="group in city_list"
										      :key="group.title"
										      :label="group.title">
										      <el-option
										        v-for="item in group.data"
										        :key="item.id"
										        :label="item.title"
										        :value="item.id">
										      </el-option>
										    </el-option-group>
										</el-select>
									</el-form-item>
								</div>
							</div>
							<div class="flex">
								<div class="flex-1">
									<el-form-item label="婚否：" prop="is_marry">
									    <el-radio-group class="ml-0 ml-sm-2" v-model="form.is_marry">
									      <el-radio :label="1">未婚</el-radio>
									      <el-radio :label="2">已婚</el-radio>
									      <el-radio :label="0">保密</el-radio>
									    </el-radio-group>
									</el-form-item>
								</div>
								<div class="flex-1">
									<el-form-item label="政治面貌：" prop="political_affiliation">
										<el-select v-model="form.political_affiliation" filterable clearable default-first-option placeholder="请选择" size="mini" class="rounded-0 w-200px">
										    <el-option
										      label="待选择"
										      :value="0"
										      disabled>
										    </el-option>
										    <el-option
										      v-for="item in political_affiliation"
										      :key="item.value"
										      :label="item.title"
										      :value="item.value">
										    </el-option>
										</el-select>
									</el-form-item>
								</div>
							</div>
							<div class="flex">
								<div class="flex-1">
									<el-form-item label="QQ：" prop="contact_qq">
										<el-input v-model="form.contact_qq" class="w-200px rounded-0" maxlength="20" size="mini"></el-input>
									</el-form-item>
								</div>
								<div class="flex-1">
									<el-form-item label="微信号：" prop="contact_wechat">
										<el-input v-model="form.contact_wechat" class="w-200px rounded-0" maxlength="20" size="mini"></el-input>
									</el-form-item>
								</div>
							</div>
							<div class="flex">
								<div class="flex-1">
									<el-form-item label="求职状态：" prop="job_status">
										<el-select ref="jobStatus" v-model="form.job_status" filterable clearable default-first-option placeholder="请选择" size="mini" class="rounded-0 w-200px">
										    <el-option
										      v-for="item in job_status"
										      :key="item.value"
										      :label="item.title"
										      :value="item.value">
										    </el-option>
										</el-select>
									</el-form-item>
								</div>
								<div class="flex-1">
									<el-form-item label="手机号：" prop="contact_wechat">
										<div class="flex flex-center">
											<div>{{userInfo.mobile}}</div>
											<div class="px-3">
												<el-link type="primary" href="/user/account">更换</el-link>
											</div>
										</div>
									</el-form-item>
								</div>
							</div>
						</div>
						<div>
							<div class="pb-2">
								<el-avatar :size="80" v-model="form.headimg" :src="userInfo.headimg"></el-avatar>
								<el-upload
																		class="avatar-uploader"
																		action="/uploadFiles"
																		name="file"
																		accept="image/*"
																		:data="{path:'user/headimg'}"
																		:show-file-list="false"
																		:on-success="handleAvatarSuccess"
																		:on-error="handleAvatarError">
									<el-button size="small" type="primary">选择文件</el-button>
								</el-upload>
						    </div>
						    <div>
					    		<el-checkbox v-model="form.headimg_status" :true-label="1" :false-label="0">{{form.headimg_status?'头像不公开':'头像公开'}}</el-checkbox>
						    </div>
						</div>
					</div>
					<div class="pt-3 flex">
						<div class="w-120px"></div>
						<div>
							<el-button native-type="submit" type="primary" size="mini">完成</el-button>
			    			<el-button @click="resetForm('basic')" size="mini">取消</el-button>
						</div>
					</div>
				</el-form>
				<div class="flex pt-4" v-show="!showForm.basic">
					<div class="flex-1">
						<div class="flex py-2">
							<div class="flex-1">
								<span class="text-secondary">姓名：</span>
								<span v-if="Find.name">{{Find.name}}</span>
								<span v-else="Find.name">未填写</span>
							</div>
							<div class="flex-1">
								<span class="text-secondary">性别：</span>
								<span v-if="Find.sex==1">男</span>
								<span v-else-if="Find.sex==2">女</span>
								<span v-else="Find.sex">未设置</span>
							</div>
							<div class="flex-1">
								<span class="text-secondary">年龄：</span>
								<span v-if="Find.age">{{XYBase.Date.getMStoYear(Find.age)}}岁</span>
								<span v-else="Find.age">未填写</span>
							</div>
						</div>
						<div class="flex py-2">
							<div class="flex-1">
								<span class="text-secondary">学历：</span>
								<span v-if="Find.educational_background">{{getEducationalBackgroundText(Find.educational_background)}}</span>
								<span v-else="Find.educational_background">未填写</span>
							</div>
							<div class="flex-1">
								<span class="text-secondary">工作经验：</span>
								<span v-if="Find.work_experience_time">{{XYBase.Date.getMStoYear(Find.work_experience_time)}}年</span>
								<span v-else="Find.work_experience_time">未填写</span>
							</div>
							<div class="flex-1">
								<span class="text-secondary">专业：</span>
								<span v-if="Find.specialities">{{Find.specialities}}</span>
								<span v-else="Find.specialities">未填写</span>
							</div>
						</div>
						<div class="flex py-2">
							<div class="flex-1">
								<span class="text-secondary">居住地：</span>
								<span v-if="Find.residence">{{getCityText(Find.residence)}}</span>
								<span v-else="Find.residence">未填写</span>
							</div>
							<div class="flex-1">
								<span class="text-secondary">籍贯：</span>
								<span v-if="Find.native_place">{{getCityText(Find.native_place)}}</span>
								<span v-else="Find.native_place">未填写</span>
							</div>
							<div class="flex-1">
								<span class="text-secondary">婚否：</span>
								<span v-if="Find.is_marry==1">未婚</span>
								<span v-else-if="Find.is_marry==2">已婚</span>
								<span v-else="Find.is_marry">保密</span>
							</div>
						</div>
						<div class="flex py-2">
							<div class="flex-1">
								<span class="text-secondary">政治面貌：</span>
								<span v-if="Find.political_affiliation">{{getPoliticalAffiliationText(Find.political_affiliation)}}</span>
								<span v-else="Find.political_affiliation">未填写</span>
							</div>
							<div class="flex-1">
								<span class="text-secondary">QQ：</span>
								<span v-if="Find.contact_qq">{{Find.contact_qq}}</span>
								<span v-else="Find.contact_qq">未填写</span>
							</div>
							<div class="flex-1">
								<span class="text-secondary">微信号：</span>
								<span v-if="Find.contact_wechat">{{Find.contact_wechat}}</span>
								<span v-else="Find.contact_wechat">未填写</span>
							</div>
						</div>
						<div class="flex py-2">
							<div class="flex-1">
								<span class="text-secondary">手机号：</span>
								{{userInfo.mobile}}
							</div>
						</div>
					</div>
					<div>
						<div class="pb-2 flex" >
							<el-avatar :size="80"  v-model="form.headimg" :src="userInfo.headimg"></el-avatar>
							<div class="ml-3 w-80px h-80px position-relative"
								 v-if="userInfo.after_avatar && userInfo.after_avatar.id" >
								<el-image
										class="w-80px h-80px rounded-circle"
										:src="userInfo.after_avatar.after_avatar"
										:preview-src-list="[userInfo.after_avatar.after_avatar]"
										fit="contain">
								</el-image>
								<div class="rounded-circle position-absolute text-small text-white text-v-center" style="top:0;left:0;right:0;bottom:0;z-index:100;background-color:rgba(0, 0, 0, .45);line-height: 1;">
									<span class="small">审核中</span>
								</div>
							</div>
					    </div>

					    <div>
					    	<el-checkbox v-model="form.headimg_status" :true-label="1" :false-label="0" @change="resumeHeadimgStatus">{{form.headimg_status?'头像不公开':'头像公开'}}</el-checkbox>
					    </div>
					</div>
				</div>
			</div>
			<!-- 求职意向 -->
			<div class="p-5 hover-show-block">
				<div class="flex">
					<div class="flex-1 block-title-before py-2">
						求职意向<span class="pl-2 text-primary">{{form.employment_intention.length}}</span>/3
					</div>
					<div class="text-v-center show-block">
						<div class="text-right">
						<el-link type="primary" icon="el-icon-edit" :underline="false" @click="showForm.employment_intention= !showForm.employment_intention" v-show="!showForm.employment_intention">编辑</el-link>
						</div>
					</div>
				</div>
				<div class="pt-4">
					<div class="flex py-2" v-for="(v,index) in Find.employment_intention">
						<div class="pointer flex flex-center"
					    @click="showForm.employment_intention=true;editItem('employment_intention',index,v);">
							<div>
								<i class="el-icon-location-outline"></i>
								<span v-if="v.job_area.length">{{getAreaText(v.job_area)}}</span>
								<span v-else>地区不限</span>
							</div>
							<div class="border-left py-1 mx-2"></div>
							<div>
								<i class="el-icon-suitcase"></i>
								{{getJobscateText(v.jobscate)}}
							</div>
							<div v-if="v.nature_of_work!==1"><span class="px-1">·</span>{{getNatureOfWorkText(v.nature_of_work)}}</div>
							<div class="border-left py-1 mx-2"></div>
							<div>
								<i class="el-icon-c-scale-to-original"></i>
								<span v-if="v.industry_id">{{getIndustryIdText(v.industry_id)}}</span>
								<span v-else>行业不限</span>
							</div>
							<div class="border-left py-1 mx-2"></div>
							<div>
								<i class="el-icon-coin"></i>
								<span v-if="v.default">面议</span>
								<span v-else>{{v.min_salary}}-{{v.max_salary}}/月</span>
							</div>
					    </div>
					    <div class="flex-1"></div>
						<div>
							<div v-show="showForm.employment_intention">
								<el-link type="primary" icon="el-icon-edit" :underline="false"
								@click="editItem('employment_intention',index,v);">编辑</el-link>
								<el-link type="danger" icon="el-icon-delete" :underline="false" @click="delItem('employment_intention',index,v);">删除</el-link>
							</div>
						</div>
					</div>
				</div>
				<el-form :model="employment_intention" @submit.native.prevent="editComplete('employment_intention');" :rules="rules" ref="employment_intention" label-width="120px" label-position="right" class="mt-4 p-4 bg-gray" v-show="showForm.employment_intention"
				size="mini">
					<div class="flex">
						<div class="flex-1">
							<el-form-item label="工作性质：" prop="nature_of_work">
								<el-select v-model="employment_intention.nature_of_work" filterable clearable default-first-option placeholder="请选择" size="mini" class="rounded-0">
								    <el-option
								      v-for="item in nature_of_work"
								      :key="item.value"
								      :label="item.title"
								      :value="item.value">
								    </el-option>
								</el-select>
							</el-form-item>
						</div>
						<div class="flex-1">
							<el-form-item label="期望行业：" prop="industry_id">
								<el-select v-model="employment_intention.industry_id" filterable clearable default-first-option placeholder="请选择" size="mini" class="rounded-0">
								    <el-option
								      v-for="item in industry"
								      :key="item.id"
								      :label="item.title"
								      :value="item.id">
								    </el-option>
								</el-select>
							</el-form-item>
						</div>
					</div>
					<div class="flex">
						<div class="flex-1">
							<el-form-item label="期望职位：" prop="jobscate">
								<el-cascader
								    v-model="employment_intention.jobscate"
								    :options="jobscate"
								    :props="defaultProps"
								    filterable
								    clearable
								    :show-all-levels="false"
								    class="rounded-0"></el-cascader>
							</el-form-item>
						</div>
						<div class="flex-1">
							<el-form-item label="工作地区：" prop="job_area">
							    <el-cascader 
							    	v-model="employment_intention.job_area"
							    	placeholder="试试搜索：北京"
							    	filterable
									:props="defaultProps"
							    	:options="arealist"
							    	class="rounded-0">
							    </el-cascader>
							</el-form-item>
						</div>
					</div>
					<div class="flex">
						<div class="flex-1">
							<el-form-item label="期望薪资：" prop="expected_salary">
							  	<div class="flex">
									<el-form-item prop="salary" class="w-100px rounded-0">
										<el-input v-if="employment_intention.default" value="面议" disabled="disabled" placeholder="最低薪资"></el-input>
										<el-input v-else v-model.number="employment_intention.expected_salary[0]" placeholder="最低薪资"></el-input>
									</el-form-item>
									<div class="w-20px text-center">~</div>
									<el-form-item prop="salary" class="w-100px rounded-0">
										<el-input v-if="employment_intention.default" value="面议" disabled="disabled" placeholder="最低薪资"></el-input>
										<el-input v-else v-model.number="employment_intention.expected_salary[1]" placeholder="最低薪资"></el-input>
									</el-form-item>
									<div class="pl-3"><el-checkbox v-model="employment_intention.default" :true-label="1" :false-label="0">面议</el-checkbox></div>
									<!-- <div class="pl-3" v-if="employment_intention.expected_salary[0]==0">面议</div>
									<div class="pl-3" v-else-if="employment_intention.expected_salary[1]">{{employment_intention.expected_salary[0]}}-{{employment_intention.expected_salary[1]}}K/月</div> -->
							    </div>
							</el-form-item>
						</div>
					</div>
					<div class="pt-3 flex">
						<div class="w-120px"></div>
						<div>
							<el-button native-type="submit" type="primary" size="mini">{{editForm.employment_intention?'保存':'添加'}}</el-button>
			    			<el-button @click="resetForm('employment_intention')" size="mini">取消</el-button>
						</div>
					</div>
				</el-form>
			</div>
			<!-- 自我描述 -->
			<div class="p-5 hover-show-block">
				<div class="flex">
					<div class="flex-1 block-title-before py-2">自我描述</div>
					<div class="text-v-center show-block">
						<div class="text-right">
						<el-link type="primary" icon="el-icon-edit" :underline="false" @click="showForm.self_description= !showForm.self_description" v-show="!showForm.self_description">编辑</el-link>
						</div>
					</div>
				</div>
				<el-form :model="form" @submit.native.prevent="editComplete('self_description');" :rules="rules" ref="self_description" label-width="0" label-position="right" class="pt-4" v-show="showForm.self_description">
					<el-form-item prop="self_description">
						<el-input
						  type="textarea"
						  :autosize="{ minRows: 6, maxRows: 10}"
						  placeholder="自我描述是你客观认识自己的基石，快来填写吧！"
						  v-model="form.self_description"
						  maxlength="200"
						  show-word-limit
						  class="rounded-0">
						</el-input>
					</el-form-item>
					<div class="pt-3">
						<el-button native-type="submit" type="primary" size="mini">完成</el-button>
		    			<el-button @click="resetForm('self_description')" size="mini">取消</el-button>
					</div>
				</el-form>
				<div class="pt-4 text-secondary" v-show="!showForm.self_description">
					<div v-if="Find.self_description" v-html="getHtml(Find.self_description)"></div>
					<div v-else>
						自我描述是你客观认识自己的基石，快来填写吧！
					</div>
				</div>
			</div>
			<!-- 教育经历 -->
			<div class="p-5 hover-show-block">
				<div class="flex">
					<div class="flex-1 block-title-before py-2">教育经历</div>
					<div class="text-v-center show-block">
						<div class="text-right">
						<el-link type="primary" icon="el-icon-edit" :underline="false" @click="showForm.educational_experience= !showForm.educational_experience" v-show="!showForm.educational_experience">编辑</el-link>
						</div>
					</div>
				</div>
				<div class="pt-4">
					<el-timeline v-if="Find.educational_experience.length>0">
					    <el-timeline-item v-for="(v,index) in Find.educational_experience">
					    	<div class="flex">
					    		<div class="flex-1 pointer"
					    		@click="showForm.educational_experience=true;editItem('educational_experience',index,v);">
							      <p>{{getEducationalBackgroundText(v.educational_background)}} 丨 {{v.school_name}} 丨 {{v.specialities}}</p>
							      <div class="text-secondary">{{XYBase.Date.date('Y.m',v.start_time)}}至{{XYBase.Date.date('Y.m',v.end_time)}}</div>
					    		</div>
								<div>
									<div v-show="showForm.educational_experience">
										<el-link type="primary" icon="el-icon-edit" :underline="false"
										@click="editItem('educational_experience',index,v);">编辑</el-link>
										<el-link type="danger" icon="el-icon-delete" :underline="false" @click="delItem('educational_experience',index,v);">删除</el-link>
									</div>
								</div>
					    	</div>
					    </el-timeline-item>
					</el-timeline>
					<div class="pt-4 text-secondary" v-else>
						完善您的教育经历，精准匹配职位！
					</div>
				</div>
				<el-form :model="educational_experience" @submit.native.prevent="editComplete('educational_experience');" :rules="rules" ref="educational_experience" label-width="120px" label-position="right" class="mt-4 p-4 bg-gray" v-show="showForm.educational_experience">
					<div class="flex">
						<div class="flex-1">
							<el-form-item label="学校：" prop="school_name">
								<el-autocomplete  v-model="educational_experience.school_name" class="w-75 rounded-0" maxlength="30" size="mini"
							    :fetch-suggestions="getSchool"
							    :trigger-on-focus="false"
							    clearable></el-autocomplete>
							</el-form-item>
						</div>
						<div class="flex-1">
							<el-form-item label="专业：" prop="specialities">
								<el-autocomplete  v-model="educational_experience.specialities" class="w-75 rounded-0" maxlength="30" size="mini"
							    :fetch-suggestions="getSpecialities"
							    :trigger-on-focus="false"
							    clearable></el-autocomplete>
							</el-form-item>
						</div>
					</div>
					<div class="flex">
						<div class="flex-1">
							<el-form-item label="学历：" prop="educational_background">
								<el-select v-model="educational_experience.educational_background" filterable clearable default-first-option placeholder="请选择" size="mini" class="rounded-0">
								    <el-option
								      v-for="item in educational_background"
								      :key="item.value"
								      :label="item.title"
								      :value="item.value">
								    </el-option>
								</el-select>
							</el-form-item>
						</div>
						<div class="flex-1">
							<el-form-item label="入学时间：">
								<div class="flex">
									<el-form-item prop="start_time" class="flex-1">
										<el-date-picker
									      v-model="educational_experience.start_time"
									      type="month"
									      placeholder="入学时间"
									      size="mini"
									      class="rounded-0 w-100"
									      format="yyyy.MM"
									      value-format="timestamp"
									      :default-value="Date.now()-(3600*24*365*3*1000)"
									      :picker-options="educationalExperienceStartPickerOptions">
									    </el-date-picker>
									</el-form-item>
									<div class="px-2">-</div>
									<el-form-item prop="end_time" class="flex-1">
										<el-date-picker
									      v-model="educational_experience.end_time"
									      type="month"
									      placeholder="毕业时间"
									      size="mini"
									      class="rounded-0 w-100"
									      format="yyyy.MM"
									      value-format="timestamp"
									      :picker-options="educationalExperienceEndPickerOptions">
									    </el-date-picker>
									</el-form-item>
								</div>
							</el-form-item>
						</div>
					</div>
					<div class="pt-3 flex">
						<div class="w-120px"></div>
						<div>
							<el-button native-type="submit" type="primary" size="mini">{{editForm.educational_experience?'保存':'添加'}}</el-button>
			    			<el-button @click="resetForm('educational_experience')" size="mini">取消</el-button>
						</div>
					</div>
				</el-form>
			</div>
			<!-- 工作经历 -->
			<div class="p-5 hover-show-block">
				<div class="flex hover-show-block">
					<div class="flex-1 block-title-before py-2">工作经历</div>
					<div class="text-v-center show-block">
						<div class="text-right">
						<el-link type="primary" icon="el-icon-edit" :underline="false" @click="showForm.work_experience= !showForm.work_experience" v-show="!showForm.work_experience">编辑</el-link>
						</div>
					</div>
				</div>
				<div v-if="Find.work_experience.length>0">
					<div class="flex pt-4" v-for="(v,index) in Find.work_experience">
						<div class="pr-2 text-secondary">
							<i class="el-icon-office-building"></i>
						</div>
						<div class="flex-1 pointer"
			    		@click="showForm.work_experience=true;editItem('work_experience',index,v);">
							<div class="flex flex-center">
								<div>{{v.company_name}} 丨 {{getJobscateText(v.jobscate)}} 丨 {{v.job_title}}</div>
								<div class="text-secondary pl-3">{{XYBase.Date.date('Y.m',v.start_time)}}-{{XYBase.Date.date('Y.m',v.end_time)}}</div>
							</div>
							<div class="text-secondary pt-3" v-html="getHtml(v.job_content)"></div>
						</div>
						<div>
							<div v-show="showForm.work_experience">
								<el-link type="primary" icon="el-icon-edit" :underline="false" @click="editItem('work_experience',index,v);">编辑</el-link>
								<el-link type="danger" icon="el-icon-delete" :underline="false" @click="delItem('work_experience',index,v);">删除</el-link>
							</div>
						</div>
					</div>
				</div>
				<div class="pt-4 text-secondary" v-else>
					完善您的工作，精准匹配职位！
				</div>
				<el-form :model="work_experience" @submit.native.prevent="editComplete('work_experience');" :rules="rules" ref="work_experience" label-width="120px" label-position="right" class="mt-4 p-4 bg-gray" v-show="showForm.work_experience">
					<div class="flex">
						<div class="flex-1">
							<el-form-item label="公司：" prop="company_name">
								<el-input v-model="work_experience.company_name" class="w-75 rounded-0" size="mini"></el-input>
							</el-form-item>
						</div>
						<div class="flex-1">
							<el-form-item label="职位名称：" prop="job_title">
								<el-input v-model="work_experience.job_title" class="w-75 rounded-0" size="mini"></el-input>
							</el-form-item>
						</div>
					</div>
					<div class="flex">
						<div class="flex-1">
							<el-form-item label="职位类型：" prop="jobscate">
								<el-cascader
								    v-model="work_experience.jobscate"
								    :options="jobscate"
								    :props="defaultProps"
								    filterable
								    clearable
								    :show-all-levels="false"
								    size="mini" class="rounded-0"></el-cascader>
							</el-form-item>
						</div>
						<div class="flex-1">
							<el-form-item label="在职时间：">
								<div class="flex">
									<el-form-item prop="start_time" class="flex-1">
										<el-date-picker
									      v-model="work_experience.start_time"
									      type="month"
									      placeholder="入职时间"
									      size="mini"
									      class="rounded-0 w-100"
									      format="yyyy.MM"
									      value-format="timestamp"
									      :picker-options="workExperienceStartPickerOptions">
									    </el-date-picker>
									</el-form-item>
									<div class="px-2">-</div>
									<el-form-item prop="end_time" class="flex-1">
										<el-date-picker
									      v-model="work_experience.end_time"
									      type="month"
									      placeholder="离职时间"
									      size="mini"
									      class="rounded-0 w-100"
									      format="yyyy.MM"
									      value-format="timestamp"
									      :picker-options="workExperienceEndPickerOptions">
									    </el-date-picker>
									</el-form-item>
								</div>
							</el-form-item>
						</div>
					</div>
					<el-form-item label="工作内容：" prop="job_content">
						<el-input
						  type="textarea"
						  :autosize="{ minRows: 6, maxRows: 10}"
						  v-model="work_experience.job_content"
						  maxlength="200"
						  show-word-limit
						  class="rounded-0">
						</el-input>
					</el-form-item>
					<div class="pt-3 flex">
						<div class="w-120px"></div>
						<div>
							<el-button native-type="submit" type="primary" size="mini">{{editForm.work_experience?'保存':'添加'}}</el-button>
			    			<el-button @click="resetForm('work_experience')" size="mini">取消</el-button>
						</div>
					</div>
				</el-form>
			</div>
			<!-- 培训经历 -->
			<div class="p-5 hover-show-block">
				<div class="flex hover-show-block">
					<div class="flex-1 block-title-before py-2">培训经历</div>
					<div class="text-v-center show-block">
						<div class="text-right">
						<el-link type="primary" icon="el-icon-edit" :underline="false" @click="showForm.training_experience= !showForm.training_experience" v-show="!showForm.training_experience">编辑</el-link>
						</div>
					</div>
				</div>
				<div v-if="Find.training_experience.length>0">
					<div class="flex pt-4" v-for="(v,index) in Find.training_experience">
						<div class="pr-2 text-secondary">
							<i class="el-icon-reading"></i>
						</div>
						<div class="flex-1 pointer"
			    		@click="showForm.training_experience=true;editItem('training_experience',index,v);">
							<div class="flex flex-center">
								<div>{{v.mechanism}} 丨 {{v.project_name}}</div>
								<div class="text-secondary pl-3">{{XYBase.Date.date('Y.m',v.start_time)}}-{{XYBase.Date.date('Y.m',v.end_time)}}</div>
							</div>
							<div class="text-secondary pt-3" v-html="getHtml(v.training_content)"></div>
						</div>
						<div>
							<div v-show="showForm.training_experience">
								<el-link type="primary" icon="el-icon-edit" :underline="false" @click="editItem('training_experience',index,v);">编辑</el-link>
								<el-link type="danger" icon="el-icon-delete" :underline="false" @click="delItem('training_experience',index,v);">删除</el-link>
							</div>
						</div>
					</div>
				</div>
				<div class="pt-4 text-secondary" v-else>
					培训经历是你用于上进的最好的体现，快来填写吧！
				</div>
				<el-form :model="training_experience" @submit.native.prevent="editComplete('training_experience');" :rules="rules" ref="training_experience" label-width="120px" label-position="right" class="mt-4 p-4 bg-gray" v-show="showForm.training_experience">
					<div class="flex">
						<div class="flex-1">
							<el-form-item label="培训机构：" prop="mechanism">
								<el-input v-model="training_experience.mechanism" class="w-75 rounded-0" size="mini"></el-input>
							</el-form-item>
						</div>
						<div class="flex-1">
							<el-form-item label="培训项目：" prop="project_name">
								<el-input v-model="training_experience.project_name" class="w-75 rounded-0" size="mini"></el-input>
							</el-form-item>
						</div>
					</div>
					<div class="flex">
						<div class="flex-1">
							<el-form-item label="培训时间：">
								<div class="flex">
									<el-form-item prop="start_time" class="flex-1">
										<el-date-picker
									      v-model="training_experience.start_time"
									      type="month"
									      placeholder="开始时间"
									      size="mini"
									      class="rounded-0 w-100"
									      format="yyyy.MM"
									      value-format="timestamp"
									      :picker-options="trainingExperienceStartPickerOptions">
									    </el-date-picker>
									</el-form-item>
									<div class="px-2">-</div>
									<el-form-item prop="end_time" class="flex-1">
										<el-date-picker
									      v-model="training_experience.end_time"
									      type="month"
									      placeholder="结束时间"
									      size="mini"
									      class="rounded-0 w-100"
									      format="yyyy.MM"
									      value-format="timestamp"
									      :picker-options="trainingExperienceEndPickerOptions">
									    </el-date-picker>
									</el-form-item>
								</div>
							</el-form-item>
						</div>
						<div class="flex-1"></div>
					</div>
					<el-form-item label="培训内容：" prop="training_content">
						<el-input
						  type="textarea"
						  :autosize="{ minRows: 6, maxRows: 10}"
						  v-model="training_experience.training_content"
						  maxlength="200"
						  show-word-limit
						  class="rounded-0">
						</el-input>
					</el-form-item>
					<div class="pt-3 flex">
						<div class="w-120px"></div>
						<div>
							<el-button native-type="submit" type="primary" size="mini">{{editForm.training_experience?'保存':'添加'}}</el-button>
			    			<el-button @click="resetForm('training_experience')" size="mini">取消</el-button>
						</div>
					</div>
				</el-form>
			</div>
			<!-- 项目经历 -->
			<div class="p-5 hover-show-block">
				<div class="flex hover-show-block">
					<div class="flex-1 block-title-before py-2">项目经历</div>
					<div class="text-v-center show-block">
						<div class="text-right">
						<el-link type="primary" icon="el-icon-edit" :underline="false" @click="showForm.project_experience= !showForm.project_experience" v-show="!showForm.project_experience">编辑</el-link>
						</div>
					</div>
				</div>
				<div v-if="Find.project_experience.length>0">
					<div class="flex pt-4" v-for="(v,index) in Find.project_experience">
						<div class="pr-2 text-secondary">
							<i class="el-icon-suitcase"></i>
						</div>
						<div class="flex-1 pointer"
			    		@click="showForm.project_experience=true;editItem('project_experience',index,v);">
							<div class="flex flex-center">
								<div>{{v.project_name}} 丨 {{v.project_role}}</div>
								<div class="text-secondary pl-3">{{XYBase.Date.date('Y.m',v.start_time)}}-{{XYBase.Date.date('Y.m',v.end_time)}}</div>
							</div>
							<div class="text-secondary pt-3" v-html="getHtml(v.project_content)"></div>
							<div class="pt-3">
								<el-link :href="v.project_link" :underline="false" type="info">{{v.project_link}}</el-link>
							</div>
						</div>
						<div>
							<div v-show="showForm.project_experience">
								<el-link type="primary" icon="el-icon-edit" :underline="false" @click="editItem('project_experience',index,v);">编辑</el-link>
								<el-link type="danger" icon="el-icon-delete" :underline="false" @click="delItem('project_experience',index,v);">删除</el-link>
							</div>
						</div>
					</div>
				</div>
				<div class="pt-4 text-secondary" v-else>
					项目经历让你的简历超越99%的竞争者，快来填写吧！
				</div>
				<el-form :model="project_experience" @submit.native.prevent="editComplete('project_experience');" :rules="rules" ref="project_experience" label-width="120px" label-position="right" class="mt-4 p-4 bg-gray" v-show="showForm.project_experience">
					<div class="flex">
						<div class="flex-1">
							<el-form-item label="项目名称：" prop="project_name">
								<el-input v-model="project_experience.project_name" class="w-75 rounded-0" size="mini"></el-input>
							</el-form-item>
						</div>
						<div class="flex-1 pl-3">
							<el-form-item label="担任角色：" prop="project_role">
								<el-input v-model="project_experience.project_role" class="w-50 rounded-0" size="mini"></el-input>
							</el-form-item>
						</div>
					</div>
					<div class="flex">
						<div class="flex-1">
							<el-form-item label="时间：">
								<div class="flex">
									<el-form-item prop="start_time" class="flex-1">
										<el-date-picker
									      v-model="project_experience.start_time"
									      type="month"
									      placeholder="开始时间"
									      size="mini"
									      class="rounded-0 w-100"
									      format="yyyy.MM"
									      value-format="timestamp"
									      :picker-options="projectExperienceStartPickerOptions">
									    </el-date-picker>
									</el-form-item>
									<div class="px-2">-</div>
									<el-form-item prop="end_time" class="flex-1">
										<el-date-picker
									      v-model="project_experience.end_time"
									      type="month"
									      placeholder="结束时间"
									      size="mini"
									      class="rounded-0 w-100"
									      format="yyyy.MM"
									      value-format="timestamp"
									      :picker-options="projectExperienceEndPickerOptions">
									    </el-date-picker>
									</el-form-item>
								</div>
							</el-form-item>
						</div>
						<div class="flex-1 pl-3">
							<el-form-item label="项目连接：" prop="project_link">
								<el-input v-model="project_experience.project_link" class="rounded-0" size="mini"></el-input>
							</el-form-item>
						</div>
					</div>
					<el-form-item label="项目描述：" prop="project_content">
						<el-input
						  type="textarea"
						  :autosize="{ minRows: 6, maxRows: 10}"
						  v-model="project_experience.project_content"
						  maxlength="200"
						  show-word-limit
						  class="rounded-0">
						</el-input>
					</el-form-item>
					<div class="pt-3 flex">
						<div class="w-120px"></div>
						<div>
							<el-button native-type="submit" type="primary" size="mini">{{editForm.project_experience?'保存':'添加'}}</el-button>
			    			<el-button @click="resetForm('project_experience')" size="mini">取消</el-button>
						</div>
					</div>
				</el-form>
			</div>
			<!-- 获得证书 -->
			<div class="p-5 hover-show-block">
				<div class="flex">
					<div class="flex-1 block-title-before py-2">获得证书</div>
					<div class="text-v-center show-block">
						<div class="text-right">
						<el-link type="primary" icon="el-icon-edit" :underline="false" @click="showForm.certificate= !showForm.certificate" v-show="!showForm.certificate">编辑</el-link>
						</div>
					</div>
				</div>
				<div class="pt-4" v-if="Find.certificate.length>0">
					<el-tag
					  v-for="(tag,index) in Find.certificate"
  					  :key="tag.certificate_name"
					  :closable="showForm.certificate"
					  type="primary"
					  class="mr-1"
					  @close="delItem('certificate',index,tag);">
					  {{tag.certificate_name}}
					</el-tag>
				</div>
				<div class="pt-4 text-secondary" v-else>
					证书是您驰骋职场的敲门砖，快来填写吧！
				</div>
				<el-form :model="certificate" @submit.native.prevent="editComplete('certificate');" :rules="rules" ref="certificate" label-width="120px" label-position="right" class="mt-4 p-4 bg-gray" v-show="showForm.certificate">
					<div class="flex">
						<div class="flex-1">
							<el-form-item label="证书名称：" prop="certificate_name">
								<el-input v-model="certificate.certificate_name" class="w-75 rounded-0" size="mini"></el-input>
							</el-form-item>
						</div>
						<div class="flex-1">
						</div>
					</div>
					<div class="pt-3 flex">
						<div class="w-120px"></div>
						<div>
							<el-button native-type="submit" type="primary" size="mini">添加</el-button>
			    			<el-button @click="resetForm('certificate')" size="mini">取消</el-button>
						</div>
					</div>
				</el-form>
			</div>
			<!-- 语言能力 -->
			<div class="p-5 hover-show-block">
				<div class="flex">
					<div class="flex-1 block-title-before py-2">语言能力</div>
					<div class="text-v-center show-block">
						<div class="text-right">
						<el-link type="primary" icon="el-icon-edit" :underline="false" @click="showForm.language_ability= !showForm.language_ability" v-show="!showForm.language_ability">编辑</el-link>
						</div>
					</div>
				</div>
				<div class="pt-4" v-if="Find.language_ability.length>0">
					<el-tag
					  v-for="(tag,index) in Find.language_ability"
  					  :key="tag.language_name"
					  :closable="showForm.language_ability"
					  type="primary"
					  class="mr-1"
					  @close="delItem('language_ability',index,tag);">
					  {{tag.language_name}}
					</el-tag>
				</div>
				<div class="pt-4 text-secondary" v-else>
					语言能力是提升求职竞争力的法宝，快来填写吧！
				</div>
				<el-form :model="language_ability" @submit.native.prevent="editComplete('language_ability');" :rules="rules" ref="language_ability" label-width="120px" label-position="right" class="mt-4 p-4 bg-gray" v-show="showForm.language_ability">
					<div class="flex">
						<div class="flex-1">
							<el-form-item label="语言：" prop="language_name">
								<el-input v-model="language_ability.language_name" class="w-75 rounded-0" size="mini"></el-input>
							</el-form-item>
						</div>
						<div class="flex-1">
						</div>
					</div>
					<div class="pt-3 flex">
						<div class="w-120px"></div>
						<div>
							<el-button native-type="submit" type="primary" size="mini">添加</el-button>
			    			<el-button @click="resetForm('language_ability')" size="mini">取消</el-button>
						</div>
					</div>
				</el-form>
			</div>
			<!-- 特长标签 -->
			<div class="p-5 hover-show-block">
				<div class="flex">
					<div class="flex-1 block-title-before py-2">特长标签</div>
					<div class="text-v-center show-block">
						<div class="text-right">
						<el-link type="primary" icon="el-icon-edit" :underline="false" @click="showForm.specialty_label= !showForm.specialty_label" v-show="!showForm.specialty_label">编辑</el-link>
						</div>
					</div>
				</div>
				<div class="pt-4" v-if="Find.specialty_label.length>0">
					<el-tag
					  v-for="(tag,index) in Find.specialty_label"
  					  :key="tag.specialty_label"
					  :closable="showForm.specialty_label"
					  type="primary"
					  class="mr-1"
					  @close="delItem('specialty_label',index,tag);">
					  {{tag.specialty_label}}
					</el-tag>
				</div>
				<div class="pt-4 text-secondary" v-else>
					秀出你的亮点，快来填写吧！
				</div>
				<el-form :model="specialty_label" @submit.native.prevent="editComplete('specialty_label');" :rules="rules" ref="specialty_label" label-width="120px" label-position="right" class="mt-4 p-4 bg-gray" v-show="showForm.specialty_label">
					<div class="flex">
						<div class="flex-1">
							<el-form-item label="特长：" prop="specialty_label">
								<el-input v-model="specialty_label.specialty_label" class="w-75 rounded-0" size="mini"></el-input>
							</el-form-item>
						</div>
						<div class="flex-1">
						</div>
					</div>
					<div class="pt-3 flex">
						<div class="w-120px"></div>
						<div>
							<el-button native-type="submit" type="primary" size="mini">添加</el-button>
			    			<el-button @click="resetForm('specialty_label')" size="mini">取消</el-button>
						</div>
					</div>
				</el-form>
			</div>
			<div class="p-5" :class="{'border-bottom':preventWindowClose}">
				<div class="py-2">
					<el-checkbox v-model="form.auto_refresh" :true-label="1" :false-label="0"
					@change="setAutoRefresh">三天内帮我自动刷新简历</el-checkbox>
				</div>
				<div class="py-2">
					<el-checkbox v-model="form.auto_consignment" :true-label="1" :false-label="0"
					@change="setAutoConsignment">三天内有好工作帮我投递</el-checkbox>
				</div>
			</div>
			<div class="p-5" v-if="preventWindowClose">
				<el-button type="primary" class="d-block w-25 rounded-0" :loading="ajaxStatus.save" @click="saveResume">保存简历</el-button>
			</div>
		</div>
	</div>
</div>
{/block}
{block name="footer"}
{include file="module/login"/}
{/block}
{block name="script"}
<script type="text/javascript">
	var educational_background={xycms:statusalias name="resume/educational_background" serialize="json"/};
	var job_status={xycms:statusalias name="resume/job_status" serialize="json"/};
	var political_affiliation={xycms:statusalias name="resume/political_affiliation" serialize="json"/};
	var nature_of_work={xycms:statusalias name="resume/nature_of_work" serialize="json"/};
	var industry={xycms:industry serialize="json"/};
	var jobscate={xycms:jobscate serialize="json"/};
	var city_list={xycms:citylist all="1" serialize="json"/};
	var arealist={xycms:arealist serialize="json"/};
	{empty name="Find"}
	var formData={
				name:'',
				sex:'',
				age:'',
				privacy:1,
				headimg_status:1,
				educational_background:'',
				work_experience_time:'',
				specialities:'',
				residence:'',
				native_place:'',
				is_marry:0,
				political_affiliation:0,
				contact_qq:'',
				contact_wechat:'',
				job_status:'',
				nature_of_work:'',
				industry_id:'',
				jobscate:'',
				job_area:'',
				expected_salary:[1000,2000],
				self_description:'',
				educational_experience:[],
				employment_intention:[],
				work_experience:[],
				training_experience:[],
				project_experience:[],
				certificate:[],
				language_ability:[],
				specialty_label:[],
				auto_consignment:0,
				auto_refresh:0,
				headimg:''
	};
	var Find={
		name:'',
		sex:'',
		age:'',
		educational_background:'',
		work_experience_time:'',
		specialities:'',
		residence:'',
		native_place:'',
		is_marry:0,
		political_affiliation:0,
		contact_qq:'',
		contact_wechat:'',
		job_status:'',
		nature_of_work:'',
		industry_id:'',
		jobscate:'',
		job_area:'',
		expected_salary:[1000,2000],
		self_description:'',
		educational_experience:[],
		employment_intention:[],
		work_experience:[],
		training_experience:[],
		project_experience:[],
		certificate:[],
		language_ability:[],
		specialty_label:[],
		auto_consignment:0,
		auto_refresh:0,
		headimg:''
	}
	{else/}
	var formData={:json_encode($Find,JSON_UNESCAPED_UNICODE)};
	var Find={:json_encode($Find,JSON_UNESCAPED_UNICODE)};
	{/empty}
</script>
<script type="text/javascript">
	var vm=new Vue({
		el:'#app',
		data:{
			view:XYBase.view,
			userInfo:UserInfo,
			loginTabs:XYBase.loginTabs,
			feedback:XYBase.feedback,
			preventWindowClose:false,
			ajaxStatus:{
				save:false,
			},
			showForm:{
				basic:false,
				employment_intention:false,
				self_description:false,
				educational_experience:false,
				work_experience:false,
				training_experience:false,
				project_experience:false,
				certificate:false,
				language_ability:false,
				specialty_label:false,
			},
			editForm:{
				educational_experience:false,
				work_experience:false,
				training_experience:false,
				project_experience:false,
			},
			educational_background:educational_background,
			job_status:job_status,
			political_affiliation:political_affiliation,
			nature_of_work:nature_of_work,
			industry:industry,
			jobscate:jobscate,
			city_list:city_list,
			arealist:arealist,
			salary:[0,100],
			salaryOptions:[[],[]],
			SalaryArray:[],
			headimg:UserInfo.headimg,
			form:formData,
			Find:Find,
			statistics:{
				resume_time:'',
				progress:'--',
				collection:'--',
				jobs_sum:'--',
				invite_aninterview_sum:'--'
			},
			educational_experience:{
				id:0,
				index:null,
				school_name:'',
				specialities:'',
				educational_background:'',
				start_time:'',
				end_time:''
			},
			employment_intention:{
				id:0,
				index:null,
				nature_of_work:1,
				expected_salary:[1000,2000],
				industry_id:'',
				jobscate:[],
				job_area:[],
				default:0
			},
			work_experience:{
				id:0,
				index:null,
				company_name:'',
				jobscate:'',
				job_content:'',
				job_title:'',
				start_time:'',
				end_time:''
			},
			training_experience:{
				id:0,
				index:null,
				project_name:'',
				mechanism:'',
				training_content:'',
				start_time:'',
				end_time:''
			},
			project_experience:{
				id:0,
				index:null,
				project_name:'',
				project_role:'',
				project_content:'',
				project_link:'',
				start_time:'',
				end_time:''
			},
			certificate:{
				id:0,
				certificate_name:'',
			},
			language_ability:{
				id:0,
				language_name:'',
			},
			specialty_label:{
				id:0,
				specialty_label:'',
			},
	        defaultProps: {
	          	value: 'id',
	          	label: 'title',
	          	children: 'data',
	        },
	        agePickerOptions:{
	        	disabledDate: (time) => {
			      return time.getTime() < Date.now()-(3600*24*365*100*1000)||time.getTime() > Date.now()-(3600*24*365*16*1000);
			  	}
	        },
	        workExperienceTimePickerOptions:{
	        	disabledDate: (time) => {
			      return time.getTime() < Date.now()-(3600*24*365*100*1000)||time.getTime() > Date.now();
			  	}
	        },
	        educationalExperienceStartPickerOptions:{
	        	disabledDate: (time) => {
			      return time.getTime() > Date.now();
			  	}
	        },
	        educationalExperienceEndPickerOptions:{
	        	disabledDate: (time) => {
			      return time.getTime() < vm.educational_experience.start_time;
			  	}
	        },
	        workExperienceStartPickerOptions:{
	        	disabledDate: (time) => {
			      return time.getTime() > Date.now();
			  	}
	        },
	        workExperienceEndPickerOptions:{
	        	disabledDate: (time) => {
			      return time.getTime() < vm.work_experience.start_time;
			  	}
	        },
	        trainingExperienceStartPickerOptions:{
	        	disabledDate: (time) => {
			      return time.getTime() > Date.now();
			  	}
	        },
	        trainingExperienceEndPickerOptions:{
	        	disabledDate: (time) => {
			      return time.getTime() < vm.training_experience.start_time;
			  	}
	        },
	        projectExperienceStartPickerOptions:{
	        	disabledDate: (time) => {
			      return time.getTime() > Date.now();
			  	}
	        },
	        projectExperienceEndPickerOptions:{
	        	disabledDate: (time) => {
			      return time.getTime() < vm.project_experience.start_time;
			  	}
	        },
	        rules: {
				name: [
					{ required: true, message: '请输入姓名', trigger: 'blur' },
				],
				sex: [
					{ required: true, message: '请选择性别', trigger: 'change' },
				],
				age: [
					{ required: true, message: '请选择出生年份', trigger: 'change' },
				],
				educational_background: [
					{ required: true, message: '请选择学历', trigger: 'change' },
				],
				work_experience_time: [
					{ required: true, message: '请选择参加工作时间', trigger: 'change' },
				],
				job_status: [
					{ required: true, message: '请选择求职状态', trigger: 'change' },
				],
				nature_of_work: [
					{ required: true, message: '请选择工作性质', trigger: 'change' },
				],
				jobscate: [
					{ required: true, message: '请选择职位类型', trigger: 'change' },
				],
				school_name: [
					{ required: true, message: '请输入学校', trigger: 'blur' },
				],
				start_time: [
					{ required: true, message: '请选择开始时间', trigger: 'change' },
				],
				end_time: [
					{ required: true, message: '请选择结束时间', trigger: 'change' },
				],
				company_name: [
					{ required: true, message: '请输入公司名称', trigger: 'blur' },
				],
				job_title: [
					{ required: true, message: '请输入职位名称', trigger: 'blur' },
				],
				job_content: [
					{ required: true, message: '请输入工作内容', trigger: 'blur' },
				],
				mechanism: [
					{ required: true, message: '请输入培训机构名称', trigger: 'blur' },
				],
				project_name: [
					{ required: true, message: '请输入项目名称', trigger: 'blur' },
				],
				training_content: [
					{ required: true, message: '请输入培训内容', trigger: 'blur' },
				],
				project_role: [
					{ required: true, message: '请输入角色', trigger: 'blur' },
				],
				project_content: [
					{ required: true, message: '请输入项目内容', trigger: 'blur' },
				],
				certificate_name: [
					{ required: true, message: '请输入证书名称', trigger: 'blur' },
				],
				language_name: [
					{ required: true, message: '请输入语言', trigger: 'blur' },
				],
				specialty_label: [
					{ required: true, message: '请输入特长', trigger: 'blur' },
				],
	        }
		},
		watch:{
		    view:XYBase.viewWatch,
		    loginTabs:XYBase.loginTabsWatch,
			userInfo:{
				handler(val,oldVal){
					if (!val.id) {
						window.location.reload();
					}
				},
				deep:true
			},
		},
		created(){
			XYBase.created(this);
			for (var i = 0; i <= 100; i++) {
				if(i===0){
					this.salaryOptions[0].push({value:i,label:'面议'});
				}else{
					this.salaryOptions[0].push({value:i,label:i});
				}
				if(i>=12 && i<=24)
					this.SalaryArray.push({value:i,label:i+'薪'});
			}
			this.salaryOptions[1].push({value:100,label:'面议'});
			this.initStatistics();
		},
		methods:XYBase.methods({
			// 此方法已被弃用！请重新考虑实现方式
			// salaryInput(val,index){
			// 	switch(index){
			// 		case 0:
			// 			this.employment_intention.expected_salary[0]=val;
			// 			if(val===0){
			// 				this.salaryOptions[1]=[{value:100,label:'面议'}];
			// 			}else if(val>=100){
			// 				this.salaryOptions[1]=[{value:100,label:'100k'}];
			// 			}else{
			// 				this.salaryOptions[1]=[];
			// 				let length=val+10;
			// 				if(length>=100){
			// 					length=101;
			// 				}
			// 				for (var i = val+1; i < length; i++) {
			// 					this.salaryOptions[1].push({value:i,label:i+'k'});
			// 				}
			// 			}
			// 			this.salary[0]=val;
			// 			this.salary[1]=this.salaryOptions[1][0].value;
			// 			this.employment_intention.expected_salary[1]=this.salaryOptions[1][0].value;
			// 		break;
			// 		case 1:
			// 		this.salary[1]=val;
			// 		this.employment_intention.expected_salary[1]=val;
			// 		break;
			// 	}
			// },
			getSpecialities(queryString,callback){
				$.ajax({
					url:'/ajax/getSpecialities',
					data:{
						key:queryString
					},
					type:'GET',
					dataType:'json',
					error:function(){},
					success:function(ret){
						if(ret){
							callback(ret.data);
						}
					},
				})
			},
			getSchool(queryString,callback){
				$.ajax({
					url:'/ajax/getSchool',
					data:{
						key:queryString
					},
					type:'GET',
					dataType:'json',
					error:function(){},
					success:function(ret){
						if(ret){
							callback(ret.data);
						}
					},
				})
			},
			editItem(formName,index,row){
				this.editForm[formName]=true;
				var obj={
					id:row.id,
					index:index,
					start_time:row.start_time,
					end_time:row.end_time
				}
				switch(formName){
					case 'educational_experience':
					obj.school_name=row.school_name
					obj.specialities=row.specialities;
					obj.educational_background=row.educational_background;
					break;
					case 'work_experience':
					obj.company_name=row.company_name;
					obj.jobscate=row.jobscate;
					obj.job_content=row.job_content;
					obj.job_title=row.job_title;
					break;
					case 'training_experience':
					obj.project_name=row.project_name;
					obj.mechanism=row.mechanism;
					obj.training_content=row.training_content;
					break;
					case 'project_experience':
					obj.project_name=row.project_name;
					obj.project_role=row.project_role;
					obj.project_content=row.project_content;
					obj.project_link=row.project_link;
					break;
					case 'employment_intention':
					obj.nature_of_work=row.nature_of_work;
					obj.job_area=row.job_area;
					obj.jobscate=row.jobscate;
					obj.industry_id=row.industry_id;
					obj.expected_salary=row.expected_salary;
					obj.default=row.default;
					// this.salary=[row.min_salary,row.max_salary];
					// if(this.salary[0]===0){
					// 	this.salaryOptions[1]=[{value:100,label:'100k'}];
					// }else if(this.salary[0]>=100){
					// 	this.salaryOptions[1]=[{value:100,label:'100k'}];
					// }else{
					// 	this.salaryOptions[1]=[];
					// 	let length=this.salary[0]+10;
					// 	if(length>=100){
					// 		length=101;
					// 	}
					// 	for (var i = this.salary[0]+1; i < length; i++) {
					// 		this.salaryOptions[1].push({value:i,label:i+'k'});
					// 	}
					// }
					// for (let i = 0; i < this.SalaryArray[1].length; i++) {
					// 	if(this.SalaryArray[1][i].value===this.form.salary_max){
					// 		this.SalaryIndex[1]=i;
					// 		break;
					// 	}
					// }
					break;
				}
				this.$data[formName]=obj;
			},
			delItem(formName,index,row){
				var _this=this;
				var title='';
				switch(formName){
					case 'employment_intention':
					title='确定要删除【'+this.getJobscateText(row.jobscate)+'】求职期望吗？';
					break;
					case 'educational_experience':
					title='确定要删除【'+row.school_name+'】教育经历吗？';
					break;
					case 'work_experience':
					title='确定要删除【'+row.company_name+'】工作经历吗？';
					break;
					case 'training_experience':
					title='确定要删除【'+row.mechanism+'】培训经历吗？';
					break;
					case 'project_experience':
					title='确定要删除【'+row.project_name+'】项目经历吗？';
					break;
					case 'certificate':
					title='确定要删除【'+row.certificate_name+'】证书吗？';
					break;
					case 'language_ability':
					title='确定要删除【'+row.language_name+'】语言吗？';
					break;
					case 'specialty_label':
					title='确定要删除【'+row.specialty_label+'】特长标签吗？';
					break;
				}
				_this.$confirm(title, '提示', {
		          confirmButtonText: '删除',
		          cancelButtonText: '取消',
		          type: 'warning'
		        }).then(() => {
					if (row.id) {
						const loading=XYBase.openloading();
						_this.sendGet({
							url:'/user/resume/delExperience/'+formName+'/'+row.id,
						},function(ret){
							loading.close();
							if (ret) {
								if (ret.code === 0) {
									_this.form[formName].splice(index,1);
									_this.Find[formName].splice(index,1);
					        		XYBase.success('已删除');
								}else{XYBase.msg(ret.msg);}
							}
						});
					}else{
						_this.form[formName].splice(index,1);
						_this.Find[formName].splice(index,1);
		        		XYBase.success('已删除');
					}
		        }).catch(() => {
		        	XYBase.msg('已取消');
		        });
			},
			getJobStatusText(id){
				var text='';
				for(i in this.job_status){
					if (this.job_status[i].value==id) {
						text=this.job_status[i].title;
						break;
					}
				}
				return text;
			},
			getNatureOfWorkText(id){
				var text='';
				for(i in this.nature_of_work){
					if (this.nature_of_work[i].value==id) {
						text=this.nature_of_work[i].title;
						break;
					}
				}
				return text;
			},
			getIndustryIdText(id){
				var text='';
				for(i in this.industry){
					if (this.industry[i].id==id) {
						text=this.industry[i].title;
						break;
					}
				}
				return text;
			},
			getJobscateText(id){
				var text='';
				for (var i = 0; i < this.jobscate.length; i++) {
					if (this.jobscate[i].id==id[0]) {
						for (var n = 0; n < this.jobscate[i].data.length; n++) {
							if (this.jobscate[i].data[n].id==id[1]) {
								for (var k = 0; k < this.jobscate[i].data[n].data.length; k++) {
									if(this.jobscate[i].data[n].data[k].id==id[2]){
										text=this.jobscate[i].data[n].data[k].title;
										break;
									}
								}
								break;
							}
						}
						break;
					}
				}
				return text;
			},
			getAreaText(id){
				var text='';
				for (var i = 0; i < this.arealist.length; i++) {
					if (this.arealist[i].id==id[0]) {
						for (var n = 0; n < this.arealist[i].data.length; n++) {
							if (this.arealist[i].data[n].id==id[1]) {
								text=this.arealist[i].data[n].title;
								break;
							}
						}
						break;
					}
				}
				return text;
			},
			getCityText(id){
				var text='';
				for (var i = 0; i < this.city_list.length; i++) {
					for (var n = 0; n < this.city_list[i].data.length; n++) {
						if(this.city_list[i].data[n].id==id){
							text=this.city_list[i].data[n].title;
							break;
						}
					}
					if (text) break;
				}
				return text;
			},
			getEducationalBackgroundText(id){
				var text='';
				for(i in this.educational_background){
					if (this.educational_background[i].value==id) {
						text=this.educational_background[i].title;
						break;
					}
				}
				return text;
			},
			getPoliticalAffiliationText(id){
				var text='';
				for(i in this.political_affiliation){
					if (this.political_affiliation[i].value==id) {
						text=this.political_affiliation[i].title;
						break;
					}
				}
				return text;
			},
			editComplete(type){
				var _this=this;
				_this.$refs[type].validate((valid) => {
				  if (valid) {
					_this.preventWindowClose=true;
				  	switch(type){
				  		case 'basic':
				  		_this.Find.name=_this.form.name;
				  		_this.Find.sex=_this.form.sex;
				  		_this.Find.age=_this.form.age;
				  		_this.Find.educational_background=_this.form.educational_background;
				  		_this.Find.work_experience_time=_this.form.work_experience_time;
				  		_this.Find.specialities=_this.form.specialities;
				  		_this.Find.residence=_this.form.residence;
				  		_this.Find.native_place=_this.form.native_place;
				  		_this.Find.is_marry=_this.form.is_marry;
				  		_this.Find.contact_qq=_this.form.contact_qq;
				  		_this.Find.contact_wechat=_this.form.contact_wechat;
				  		_this.Find.political_affiliation=_this.form.political_affiliation;;
						_this.showForm[type]=false;
				  		break;
				  		case 'employment_intention':
				  		if(!_this.employment_intention.id&&_this.form.employment_intention.length>=3)
				  			return XYBase.msg('求职意向已达上限');
				  		var obj={
				  			id:_this.employment_intention.id,
				  			job_area:_this.employment_intention.job_area,
							jobscate:_this.employment_intention.jobscate,
							nature_of_work:_this.employment_intention.nature_of_work,
							industry_id:_this.employment_intention.industry_id,
							expected_salary:_this.employment_intention.expected_salary,
							min_salary:_this.employment_intention.expected_salary[0],
							max_salary:_this.employment_intention.expected_salary[1],
							default: _this.employment_intention.default
				  		};
				  		if (_this.editForm[type] && _this.employment_intention.index!=null) {
				  			obj.edit=1;
					  		_this.form.employment_intention[_this.employment_intention.index]=obj;
					  		_this.Find.employment_intention[_this.employment_intention.index]=obj;
					  		 _this.employment_intention.index=null;
					  		 _this.editForm[type]=false;
				  		}else{
					  		_this.form.employment_intention.push(obj);
					  		_this.Find.employment_intention.push(obj);
				  		}
			  			// _this.salaryInput(0,0); 已弃用！！！
						_this.$refs[type].resetFields();
				  		break;
				  		case 'self_description':
				  			_this.Find.self_description=_this.form.self_description;
							_this.showForm[type]=false;
				  		break;
				  		case 'educational_experience':
				  		var obj={
				  			id:_this.educational_experience.id,
				  			school_name:_this.educational_experience.school_name,
							specialities:_this.educational_experience.specialities,
							educational_background:_this.educational_experience.educational_background,
							start_time:_this.educational_experience.start_time,
							end_time:_this.educational_experience.end_time,
				  		};
				  		if (_this.editForm[type] && _this.educational_experience.index!=null) {
				  			obj.edit=1;
					  		_this.form.educational_experience[_this.educational_experience.index]=obj;
					  		_this.Find.educational_experience[_this.educational_experience.index]=obj;
					  		 _this.educational_experience.index=null;
					  		 _this.editForm[type]=false;
				  		}else{
					  		_this.form.educational_experience.push(obj);
					  		_this.Find.educational_experience.push(obj);
				  		}
						_this.$refs[type].resetFields();
				  		break;
				  		case 'work_experience':
				  		var obj={
				  			id:_this.work_experience.id,
					  		company_name:_this.work_experience.company_name,
							jobscate:_this.work_experience.jobscate,
							job_title:_this.work_experience.job_title,
							start_time:_this.work_experience.start_time,
							end_time:_this.work_experience.end_time,
							job_content:_this.work_experience.job_content,
				  		};
				  		if (_this.editForm[type] && _this.work_experience.index!=null) {
				  			obj.edit=1;
					  		_this.form.work_experience[_this.work_experience.index]=obj;
					  		_this.Find.work_experience[_this.work_experience.index]=obj;
					  		 _this.work_experience.index=null;
					  		 _this.editForm[type]=false;
				  		}else{
					  		_this.form.work_experience.push(obj);
					  		_this.Find.work_experience.push(obj);
				  		}
						_this.$refs[type].resetFields();
				  		break;
				  		case 'training_experience':
				  		var obj={
				  			id:_this.training_experience.id,
				  			mechanism:_this.training_experience.mechanism,
							project_name:_this.training_experience.project_name,
							start_time:_this.training_experience.start_time,
							end_time:_this.training_experience.end_time,
							training_content:_this.training_experience.training_content,
				  		};
				  		if (_this.editForm[type] && _this.training_experience.index!=null) {
				  			obj.edit=1;
					  		_this.form.training_experience[_this.training_experience.index]=obj;
					  		_this.Find.training_experience[_this.training_experience.index]=obj;
					  		 _this.training_experience.index=null;
					  		 _this.editForm[type]=false;
				  		}else{
					  		_this.form.training_experience.push(obj);
					  		_this.Find.training_experience.push(obj);
				  		}
						_this.$refs[type].resetFields();
				  		break;
				  		case 'project_experience':
				  		var obj={
				  			id:_this.project_experience.id,
				  			project_name:_this.project_experience.project_name,
							project_role:_this.project_experience.project_role,
							start_time:_this.project_experience.start_time,
							end_time:_this.project_experience.end_time,
							project_link:_this.project_experience.project_link,
							project_content:_this.project_experience.project_content,
				  		};
				  		if (_this.editForm[type] && _this.project_experience.index!=null) {
				  			obj.edit=1;
					  		_this.form.project_experience[_this.project_experience.index]=obj;
					  		_this.Find.project_experience[_this.project_experience.index]=obj;
					  		 _this.project_experience.index=null;
					  		 _this.editForm[type]=false;
				  		}else{
					  		_this.form.project_experience.push(obj);
					  		_this.Find.project_experience.push(obj);
				  		}
						_this.$refs[type].resetFields();
				  		break;
				  		case 'certificate':
							_this.form.certificate.push({
								id:0,certificate_name:_this.certificate.certificate_name});
							_this.Find.certificate.push({
								id:0,certificate_name:_this.certificate.certificate_name});
							_this.$refs[type].resetFields();
				  		break;
				  		case 'language_ability':
							_this.form.language_ability.push({
								id:0,language_name:_this.language_ability.language_name});
							_this.Find.language_ability.push({
								id:0,language_name:_this.language_ability.language_name});
							_this.$refs[type].resetFields();
				  		break;
				  		case 'specialty_label':
							_this.form.specialty_label.push({
								id:0,specialty_label:_this.specialty_label.specialty_label});
							_this.Find.specialty_label.push({
								id:0,specialty_label:_this.specialty_label.specialty_label});
							_this.$refs[type].resetFields();
				  		break;
				  	}
				  } else {
					XYBase.warning('请先把表单填写完整。');
				    return false;
				  }
				});
			},
			resetForm:function(formName) {
				this.showForm[formName]=false;
				switch(formName){
					case 'educational_experience':
			  		if (this.editForm[formName] 
			  			&& this.educational_experience.index!=null) {
						this.$refs[formName].resetFields();
			  		}
			  		this.educational_experience.index=null;
					break;
					case 'work_experience':
			  		if (this.editForm[formName] 
			  			&& this.work_experience.index!=null) {
						this.$refs[formName].resetFields();
			  		}
			  		this.work_experience.index=null;
					break;
					case 'training_experience':
			  		if (this.editForm[formName] 
			  			&& this.training_experience.index!=null) {
						this.$refs[formName].resetFields();
			  		}
			  		this.training_experience.index=null;
					break;
					case 'project_experience':
			  		if (this.editForm[formName] 
			  			&& this.project_experience.index!=null) {
						this.$refs[formName].resetFields();
			  		}
			  		this.project_experience.index=null;
					break;
					case 'employment_intention':
			  		if (this.editForm[formName] 
			  			&& this.employment_intention.index!=null) {
						this.$refs[formName].resetFields();
			  		}
			  		this.salaryInput(0,0);
			  		this.employment_intention.index=null;
					break;
				}
		  		this.editForm[formName]=false;
			},
			resumeHeadimgStatus(val){
				var _this=this;
				var loading=XYBase.openloading();
				_this.sendGet({
					url:'/user/resume/setResumeHeadimgStatus/'+val,
				},function(ret){
					loading.close();
					if (ret) {
						if (ret.code === 0) {
							XYBase.success(ret.msg);
						}else{
							_this.form.headimg_status=val?0:1;
							XYBase.msg(ret.msg);
						}
					}
				});
			},
			setResumePrivacy(val){
				var _this=this;
				var loading=XYBase.openloading();
				_this.sendGet({
					url:'/user/resume/setResumePrivacy/'+val,
				},function(ret){
					loading.close();
					if (ret) {
						if (ret.code === 0) {
							_this.form.privacy=val;
							XYBase.success(ret.msg);
						}else{
							_this.form.privacy=val?0:1;
							XYBase.msg(ret.msg);
						}
					}
				});
			},
			saveResume(){
				var _this=this;
				_this.ajaxStatus.save=true;
				_this.sendPost({
					url:'/user/saveResume',
					data:_this.form,
				},function(ret){
					_this.ajaxStatus.save=false;
					if (ret) {
						if (ret.code === 0) {
							_this.form=ret.data;
							_this.Find=ret.data;
							XYBase.success(ret.msg);
							_this.preventWindowClose=false;
							setTimeout(function(){
								window.location.reload();
							},300);
						}else{
							XYBase.msg(ret.msg);
						}
					}
				});
			},
			setResumeRefreshTime(){
				var _this=this;
				var loading=XYBase.openloading();
				_this.sendGet({
					url:'/user/resume/setResumeRefreshTime',
				},function(ret){
					loading.close();
					if (ret) {
						if (ret.code === 0) {
							_this.Find.refresh_time=ret.time;
						}else XYBase.msg(ret.msg);
					}
				});
			},
			setAutoRefresh(){},
			setAutoConsignment(){
				var _this=this;
				var loading=XYBase.openloading();
				_this.sendGet({
					url:'/user/resume/setAutoConsignment',
				},function(ret){
					loading.close();
					_this.form.auto_consignment=0;
					if (ret) {
						if (ret.code === 0) {
							_this.form.auto_consignment=ret.data.auto_consignment;
						}else XYBase.msg(ret.msg);
					}
				});
			},
			initStatistics(){
				var _this=this;
				_this.sendGet({
					url:'/user/statistics'
				},function(ret){
					if (ret && ret.code === 0) _this.statistics=ret.data;
				});
			},
			handleAvatarSuccess:function(res, file) {
				if(res){
					if(res.code === 0){
						if(res.data.type == 'user/headimg'){
							this.form.headimg=res.data.path;
							this.headimg=res.data.url;
						}
						XYBase.success(res.msg);
					}else{XYBase.error(res.msg);}
				}else{XYBase.error(XYBase.config.system_network_error)}
			},
			handleAvatarError:function(res, file) {
				XYBase.error(XYBase.config.system_network_error)
			}
		})
	});
	window.onbeforeunload=function(e){
		if (vm.preventWindowClose) {
			vm.$confirm('您的简历还未保存，确定离开当前页面吗？', '提示', {
	          confirmButtonText: '保存',
	          cancelButtonText: '取消',
	          type: 'warning'
	        }).then(() => {
	        	vm.saveResume();
	        }).catch(() => {
				vm.preventWindowClose=false;
	        	XYBase.msg('已取消');
	        });
		　　var e = window.event||e;  
		　　e.returnValue=("确定离开当前页面吗？");
		}
	} 
</script>
{/block}